package com.ccb.sc.common.modules.setting.enums;

import com.baomidou.mybatisplus.annotation.IEnum;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;

/**
 * 套餐类型
 *
 * @author ken
 * @since 2020-09-21
 */
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
@Getter
public enum SettingsStatus implements IEnum<Integer> {
    /**
     * 申请中
     */
    WAIT(1, "申请中"),
    /**
     * 已成功
     */
    SUCCESS(2, "已成功"),
    ;

    private int value;
    private String desc;

    SettingsStatus(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    @Override
    public Integer getValue() {
        return this.value;
    }

    public static SettingsStatus getByValue(int value) {
        for (SettingsStatus unit : SettingsStatus.values()) {
            if (value == unit.getValue()) {
                return unit;
            }
        }
        return null;
    }
}
